<!-- ----------------------------------------------------------物资采购详情表------------------------------------- -->
<template>
  <div>
    <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px">
      <el-table-column prop="cargoName" label="货物名称"></el-table-column>
      <el-table-column prop="typeName" label="类型"></el-table-column>
      <el-table-column prop="textureName" label="材质"></el-table-column>
      <el-table-column prop="skuName" label="规格"></el-table-column>
      <el-table-column prop="space" label="产地" ></el-table-column>
      <el-table-column prop="number" label="数量"></el-table-column>
      <el-table-column prop="useInfo" label="用途描述"></el-table-column>
      <el-table-column prop="proposer" label="申请人"></el-table-column>
      <el-table-column prop="expectTime" label="期望交付日期"></el-table-column>
      <el-table-column prop="remark" label="备注"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" ></el-table-column>
      <el-table-column prop="isState" label="状态" :formatter="statusText"></el-table-column>
      <el-table-column prop="approver" label="审批人"></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      // form: {
      //   id:"",
      //   cargoName:"",
      //   typeID:"", 
      //   textureID:"",
      //   skuName:"",
      //   space:"",
      //   number:"",
      //   useInfo:"",
      //   expectTime:"",
      //   remark:"",
      //   proposer:"",
      //   createTime:"",
      //   approver:"",
      //   isState:"",
      // },
    };
  },
  created: function () {
    this.axios
        .get(
          "https://localhost:44331/api/app/cargo_Information/details/" 
        )
        .then((res) => {
          this.ruleFormEdit = res.data;
        });
  },
  methods: {
    statusText: function (row, column, cellValue, index) {
      if (row.isState == 1) {
        return "待审批";
      } else if(row.isState == 2) {
        return "待提交";
      }else if(row.isState == 3) {
        return "已通过";
      }else if(row.isState == 4) {
        return "已拒绝";
      }
    },
  },
};
</script>

<style scoped>
.table-grid-content {
  border-radius: 4px;
  height: 50px;
  background: #ebeef5;
  padding: 10px;
}
</style>